//
//  TravelDetailModel.m
//  NineGroupProject
//
//  Created by dllo on 15/12/26.
//  Copyright © 2015年 lushan. All rights reserved.
//

#import "TravelDetailModel.h"
#import "Notes.h"
@implementation TravelDetailModel
-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"description"]) {
        self.placeDescription = (NSString *)value;
//        self.height = [LabelTableViewCell heightForContent:self.placeDescription];
    }
    if ([key isEqualToString:@"id"]) {
        self.myID = (NSString *)value;
    }
    
}

-(void)setValue:(id)value forKey:(NSString *)key{
    
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"notes"]) {
        NSMutableArray *array = [NSMutableArray array];
        for (NSMutableDictionary *dic in value) {
            Notes *notes = [[Notes alloc] init];
            [notes setValuesForKeysWithDictionary:dic];
            [array addObject:notes];
        }
        self.notes = [NSMutableArray arrayWithArray:array];
    }
    
    
}

@end
